package com.ty.day3;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/24 15:09
 */
public class ComparableDemo {
    public static void main(String[] args) {
        Person1 person1 = new Person1();
        System.out.println(person1);
        Person person = new Person();
        System.out.println(person);
    }
}
class Person{
    int id;
    String name;
    int age;
    int sex;

    @Override
    public String toString() {
        return "Person{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex=" + sex +
                '}';
    }
}
class Person1{
    Integer id;
    String name;
    Integer age;
    String sex;

    @Override
    public String toString() {
        return "Person1{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                '}';
    }
}
